using System;
using System.Collections;
using System.Runtime.InteropServices;
namespace BMC.ARSystem
{
	[ARStructTypeInfo(Name = "ARCallGuideStruct", NumberOfMembers = 8u), ClassInterface, Guid("6908b54a-1b25-43f6-a9b0-4192a006cf7c"), ProgId("BMC.ARSystem.CallGuideAction")]
	public class CallGuideAction : Action
	{
		[Guid("29859905-5bd7-4c12-9a50-418b1fc2fc99")]
		public enum CallGuideMode
		{
			Unknown,
			OpenFormAsHidden,
			OnSelectedTableRows
		}
		[ARStructMemTypeInfo(Name = "serverName", Offset = 0u)]
		private string _serverName;
		[ARStructMemTypeInfo(Name = "guideName", Offset = 1u)]
		private string _guideName;
		[ARStructMemTypeInfo(Name = "guideMode", Offset = 2u)]
		private int _guideMode;
		[ARStructMemTypeInfo(Name = "guideTableId", Offset = 3u)]
		private uint _guideTableId;
		[ARStructMemTypeInfo(Name = "inputValueFieldPairs", Offset = 4u)]
		private ArrayList _inputValueFieldPairs;
		[ARStructMemTypeInfo(Name = "outputValueFieldPairs", Offset = 5u)]
		private ArrayList _outputValueFieldPairs;
		[ARStructMemTypeInfo(Name = "sampleServer", Offset = 6u)]
		private string _sampleServer;
		[ARStructMemTypeInfo(Name = "sampleGuide", Offset = 7u)]
		private string _sampleGuide;
		public string ServerName
		{
			get
			{
				return this._serverName;
			}
			set
			{
				this._serverName = value;
			}
		}
		public string GuideName
		{
			get
			{
				return this._guideName;
			}
			set
			{
				this._guideName = value;
			}
		}
		public CallGuideAction.CallGuideMode GuideMode
		{
			get
			{
				return (CallGuideAction.CallGuideMode)this._guideMode;
			}
			set
			{
				this._guideMode = (int)value;
			}
		}
		public uint GuideTableId
		{
			get
			{
				return this._guideTableId;
			}
			set
			{
				this._guideTableId = value;
			}
		}
		public ArrayList InputValueFieldPairs
		{
			get
			{
				return this._inputValueFieldPairs;
			}
			set
			{
				this._inputValueFieldPairs = value;
			}
		}
		public ArrayList OutputValueFieldPairs
		{
			get
			{
				return this._outputValueFieldPairs;
			}
			set
			{
				this._outputValueFieldPairs = value;
			}
		}
		public string SampleServer
		{
			get
			{
				return this._sampleServer;
			}
			set
			{
				this._sampleServer = value;
			}
		}
		public string SampleGuide
		{
			get
			{
				return this._sampleGuide;
			}
			set
			{
				this._sampleGuide = value;
			}
		}
		public CallGuideAction()
		{
		}
		internal CallGuideAction(object[] rawData, Server server)
		{
			int[] indexSpec = new int[1];
			this.ServerName = (string)Util.GetAt(rawData, indexSpec);
			if (server.Session.SecondaryServerName != null && server.Session.SecondaryServerName.StartsWith("$") && server.Session.SecondaryServerName.EndsWith("$"))
			{
				server.Session.SecondaryServerName = this.SampleServer;
			}
			else
			{
				if (server.Session.SecondaryServerName != null && (server.Session.SecondaryServerName.Equals("@") || server.Session.SecondaryServerName.EndsWith("*")))
				{
					server.Session.SecondaryServerName = server.Session.PrimaryServerName;
				}
			}
			this.GuideName = (string)Util.GetAt(rawData, new int[]
			{
				1
			});
			this.GuideMode = (CallGuideAction.CallGuideMode)Convert.ToInt32(Util.GetAt(rawData, new int[]
			{
				2
			}));
			this.GuideTableId = Convert.ToUInt32(Util.GetAt(rawData, new int[]
			{
				3
			}));
			bool flag;
			bool flag2;
			this.InputValueFieldPairs = Util.BuildFieldAssignmentList(Util.GetAt(rawData, new int[]
			{
				4
			}), server.Session.GetServer(server.Session.SecondaryServerName), server.Session.CurrentRemoteForm, server.Session.CurrentLocalForm, out flag, out flag2);
			this.OutputValueFieldPairs = Util.BuildFieldAssignmentList(Util.GetAt(rawData, new int[]
			{
				5
			}), server, server.Session.CurrentLocalForm, server.Session.CurrentRemoteForm, out flag, out flag2);
			this.SampleServer = (string)Util.GetAt(rawData, new int[]
			{
				6
			});
			this.SampleGuide = (string)Util.GetAt(rawData, new int[]
			{
				7
			});
		}
	}
}
